package com.eight.cloud.core.global.exception;

import com.eight.cloud.core.global.result.IResultCode;
import com.eight.cloud.core.global.result.ResultCode;

/**
 * @ClassName: MessageTooLargeException
 * @Author: TXC
 * @Date: 2025-08-13 15:32
 **/
public class MessageTooLargeException extends RuntimeException {
    protected Integer code;
    protected String message;

    public MessageTooLargeException(IResultCode resultCode, Throwable e) {
        super(resultCode.getMessage(), e);
        this.code = resultCode.getCode();
        this.message = resultCode.getMessage();
    }

    public MessageTooLargeException(IResultCode resultCode) {
        this(resultCode, null);
    }

    public MessageTooLargeException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public MessageTooLargeException(String message) {
        super(message);
        this.code = ResultCode.ERROR.getCode();
        this.message = message;
    }

    public MessageTooLargeException(String message, Throwable e) {
        super(message, e);
        this.code = ResultCode.ERROR.getCode();
        this.message = message;
    }
}
